Release 10.1A: OpenEdge Development:
.NET Open Clients


Getting OUTPUT parameter values

After running a procedure or user-defined function, you can access the OUTPUT parameters using the following ParamArray method:

Syntax
public System.Object GetOutputParameter(int paramNum) 

paramNum

Specifies the 0-based position of the parameter.

The output value is always returned as a System.Object. If the Object returned cannot be null, you need to cast the Object to the output parameter data type and assign it to the output variable you have created to hold the cast value. If the Object returned can be null, you need to assign it to the Value property of a holder object, then test for null before obtaining the appropriate data type value as output.

Example 8–7 shows getting an output integer parameter (or the output side of an input-output parameter) that might be set to the Unknown value (?) in the 4GL:

Example 8–7: Getting output parameters using the .NET OpenAPI
IntHolder hCustomerNumber = new IntHolder(); 
Int32 CustomerNumber = 33; 
// Set the parameter and run the procedure 
ParamArray parms = new ParamArray(1); 
parms.AddInteger(0, CustomerNumber, ParamArrayMode.INPUT-OUTPUT); 
... 
// Fill the output parameter 
hCustomerNumber.Value = parms.GetOutputParameter(0); 
if (hCustomerNumber.IsNull == true) ...; 
else CustomerNumber = hCustomerNumber.IntValue; 
... 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095